package com.cn.qtms.entity;//类注释设置模板

import com.cn.qtms.base.entity.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Name:TmGoods
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-12-25 18:37
 **/
@Entity
@Table(name = "tm_goods")
@org.hibernate.annotations.Table(appliesTo = "tm_goods",comment="商品信息表")
@Getter
@Setter
public class TmGoods extends BaseEntity {

    /***
     * 标题
     */
    @Column(name = "title")
    private String title;

    /***
     * 编码
     */
    @Column(name = "goods_code")
    private String goodsCode;

    /***
     * 商品名
     */
    @Column(name = "goods_name")
    private String goodsName;

    /***
     * 分类ID
     */
    @Column(name = "goods_type_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long goodsTypeId;

    /***
     * 供应商ID
     */
    @Column(name = "supplier_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long supplierId;

    /***
     * 市场价
     */
    @Column(name = "market_price")
    private BigDecimal marketPrice;

    /***
     * 结算类型 1底价结算 2销售分佣
     */
    @Column(name = "account_type")
    private String accountType;

    /***
     * 市场价
     */
    @Column(name = "account_price")
    private BigDecimal accountPrice;

    /***
     * 分佣比例
     */
    @Column(name = "account_ratio")
    private BigDecimal accountRatio;

    /***
     * 是否限制购买超过1张
     */
    @Column(name = "is_restrict")
    private Boolean isRestrict;

    /***
     * 状态 1 审核中 2下架 3上架 4审核不通过
     */
    @Column(name = "status")
    private String status;


    @ApiModelProperty(value = "库存数")
    @Column(name = "sums", columnDefinition = "int COMMENT '库存数'")
    private Integer sums;


    @ApiModelProperty(value = "可销售库存数")
    @Column(name = "currents", columnDefinition = "int COMMENT '可销售库存数'")
    private Integer currents;

    @Column(name = "min_user_level", columnDefinition = "int(10) COMMENT '最低购买会员等级'")
    private Integer minUserLevel;

    @Column(name = "sale_price", columnDefinition = "decimal(9,2) COMMENT '会员等级市场价'")
    private BigDecimal salePrice;
}